<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateMaterialAssignTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('material_assign', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('material_id',false)->default(0)->index()->comment('材料Id');
            $table->bigInteger('data_id',false)->default(0)->comment('分配数据id');
            $table->unsignedTinyInteger('type',false)->default(1)->comment('类型');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('material_assign');
    }
}
